package han.chensing.latos.common.level.util;

import java.util.Objects;

public class ObjectUtil {
    public static boolean checkNull(Object... objects){
        if (objects==null)return true;
        for (Object object : objects)
            if (object==null)return true;
        return false;
    }

    public static void conditionWithCommon(boolean condition, Runnable ifTrue, Runnable commonAfter){
        if (condition) ifTrue.run();
        commonAfter.run();
    }

    public static boolean isInEnum(Enum<?>[] enumArray, String name){
        for (Enum<?> anEnum : enumArray)
            if (Objects.equals(anEnum.name(),name))return true;
        return false;
    }
}
